package tx.bjdacp.dao;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bjdacp.model.*;
import tx.bjdacp.dao.*;
import tx.bjdacp.service.*;
import tx.bjdacp.vo.query.*;


import static cn.org.rapid_framework.util.ObjectUtils.*;
import org.springframework.stereotype.Repository;

@Repository
public class UserInfoDao extends BaseHibernateDao<UserInfo,java.lang.Integer>{

	public Class getEntityClass() {
		return UserInfo.class;
	}

	public Page findPage(UserInfoQuery query) {
        // [column]为字符串拼接, {column}为使用占位符. [column]为使用字符串拼接,如username='[username]',偷懒时可以使用字符串拼接
        // [column] 为PageRequest的属性
		String sql = "select t from UserInfo t where 1=1 "
			  	+ "/~ and t.username = {username} ~/"
			  	+ "/~ and t.password = {password} ~/"
			  	+ "/~ and t.sex = {sex} ~/"
			  	+ "/~ and t.realName like '%[realName]%' ~/"
			  	+ "/~ and t.isLogout = {isLogout} ~/"
				+ "/~ order by [sortColumns] ~/";


		return pageQuery(sql,query);
	}


}
